package nl.hanze.designpatterns.mvc.view.menu;

import javax.swing.JMenu;
import javax.swing.JMenuItem;

import nl.hanze.designpatterns.mvc.controller.DashboardController;

public class DashboardMenu extends Menu<DashboardController> {

	public static final String TROUBLE_TICKET_OVERVIEW = "menu_trouble_ticket_overview";
	public static final String TROUBLE_TICKET_ADD = "menu_trouble_ticket_add";
	public static final String THESAURUS = "menu_thesaurus";
	
	private JMenu userMenu;
	private JMenu troubleTicketMenu;
	private JMenu helpMenu;
	
	private JMenuItem troubleTicketOverviewItem;
	private JMenuItem troubleTicketAddItem;
	
	private JMenuItem helpSearchItem;
	
	private JMenuItem userSignOutItem;
	private JMenuItem userProfileItem;
	
	public DashboardMenu(DashboardController controller) {
		super(controller);
		
		// ### TROUBLE TICKET MENU
		troubleTicketMenu = new JMenu("Trouble Ticket");
		
		troubleTicketOverviewItem = new JMenuItem("Overview");
		troubleTicketOverviewItem.addActionListener(controller);
		troubleTicketOverviewItem.setActionCommand(TROUBLE_TICKET_OVERVIEW);
		
		troubleTicketAddItem = new JMenuItem("Add");
		troubleTicketAddItem.addActionListener(controller);
		troubleTicketAddItem.setActionCommand(TROUBLE_TICKET_ADD);
		
		troubleTicketMenu.add(troubleTicketOverviewItem);
		troubleTicketMenu.add(troubleTicketAddItem);
		
		// ### THESAURUS MENU
		helpMenu = new JMenu("Thesaurus");
		
		helpSearchItem = new JMenuItem("Search");
		helpSearchItem.addActionListener(controller);
		helpSearchItem.setActionCommand(THESAURUS);
		
		helpMenu.add(helpSearchItem);
		
		// #### USER MENU
		userMenu = new JMenu("User");
		
		userSignOutItem = new JMenuItem("Sign out");
		userSignOutItem.addActionListener(controller);
		userSignOutItem.setActionCommand("menu_user_sign_out");
		
		userProfileItem = new JMenuItem("Profile");
		userProfileItem.addActionListener(controller);
		userProfileItem.setActionCommand("menu_user_profile");
		
		userMenu.add(userProfileItem);
		userMenu.add(userSignOutItem);
		
		add(troubleTicketMenu);
		add(helpMenu);
		add(userMenu);
	}

}
